//Design By Do Trung --- Email : trungqn19852003@yahoo.com
//Ngày Design :5/4/2011 5:00:32 PM
using System;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using System.Linq;
using System.Collections.Generic;
 

	/// <summary>
	/// </summary>
	public class ThanhVien_BA
	{
		public ThanhVien_BA() {}
#region 'Variables And Properties'
		 private string string_TenDangNhap ;
		 public string TenDangNhap
			{
			 get 	
				{
					 return this.string_TenDangNhap;
				}
			 set 	
				{
					string_TenDangNhap=value;
				}
			}
		 private string string_MatKhau ;
		 public string MatKhau
			{
			 get 	
				{
					 return this.string_MatKhau;
				}
			 set 	
				{
					string_MatKhau=value;
				}
			}
		 private int int_IdQuyen ;
		 public int IdQuyen
			{
			 get 	
				{
					 return this.int_IdQuyen;
				}
			 set 	
				{
					int_IdQuyen=value;
				}
			}
		 private string string_TenDayDu ;
		 public string TenDayDu
			{
			 get 	
				{
					 return this.string_TenDayDu;
				}
			 set 	
				{
					string_TenDayDu=value;
				}
			}
		 private string string_NgaySinh ;
		 public string NgaySinh
			{
			 get 	
				{
					 return this.string_NgaySinh;
				}
			 set 	
				{
					string_NgaySinh=value;
				}
			}
		 private string string_DiaChi ;
		 public string DiaChi
			{
			 get 	
				{
					 return this.string_DiaChi;
				}
			 set 	
				{
					string_DiaChi=value;
				}
			}
		 private string string_SoDienThoai ;
		 public string SoDienThoai
			{
			 get 	
				{
					 return this.string_SoDienThoai;
				}
			 set 	
				{
					string_SoDienThoai=value;
				}
			}
		 private string string_NgayThamGia ;
		 public string NgayThamGia
			{
			 get 	
				{
					 return this.string_NgayThamGia;
				}
			 set 	
				{
					string_NgayThamGia=value;
				}
			}
		 private string string_Email ;
		 public string Email
			{
			 get 	
				{
					 return this.string_Email;
				}
			 set 	
				{
					string_Email=value;
				}
			}
		 private bool bool_TrangThai ;
		 public bool TrangThai
			{
			 get 	
				{
					 return this.bool_TrangThai;
				}
			 set 	
				{
					bool_TrangThai=value;
				}
			}
#endregion

		/// <summary>
		/// Inserts a record into the ThanhVien table.
		/// <summary>
		/// <param name="TenDangNhap"></param>
		/// <param name="MatKhau"></param>
		/// <param name="IdQuyen"></param>
		/// <param name="TenDayDu"></param>
		/// <param name="NgaySinh"></param>
		/// <param name="DiaChi"></param>
		/// <param name="SoDienThoai"></param>
		/// <param name="NgayThamGia"></param>
		/// <param name="Email"></param>
		/// <param name="TrangThai"></param>
		/// <returns></returns>
		public bool Insert(SqlConnection SqlCnn)
		{
			bool boolInsert = false ;
			ThanhVien_DA clsDA_ThanhVien = new ThanhVien_DA();
			clsDA_ThanhVien.TenDangNhap=string_TenDangNhap;
			clsDA_ThanhVien.MatKhau=string_MatKhau;
			clsDA_ThanhVien.IdQuyen=int_IdQuyen;
			clsDA_ThanhVien.TenDayDu=string_TenDayDu;
			clsDA_ThanhVien.NgaySinh=string_NgaySinh;
			clsDA_ThanhVien.DiaChi=string_DiaChi;
			clsDA_ThanhVien.SoDienThoai=string_SoDienThoai;
			clsDA_ThanhVien.NgayThamGia=string_NgayThamGia;
			clsDA_ThanhVien.Email=string_Email;
			clsDA_ThanhVien.TrangThai=bool_TrangThai;

			boolInsert = clsDA_ThanhVien.Insert(SqlCnn);
			clsDA_ThanhVien = null ;
			return boolInsert;
		}

		/// <summary>
		/// Selects a single record from the ThanhVien table.
		/// <summary>
		/// <returns>DataTable</returns>
		public DataTable Select(SqlConnection SqlCnn)
		{
			ThanhVien_DA clsDA_ThanhVien = new ThanhVien_DA();
			DataTable dt = new DataTable();
			dt=clsDA_ThanhVien.Select(SqlCnn);
			clsDA_ThanhVien= null ;
			return dt;
		}

		/// <summary>
		/// Selects a single record from the ThanhVien table.
		/// <summary>
		/// <returns>DataTable</returns>
		public DataTable SelectPrimaryKey(SqlConnection SqlCnn)
		{
			ThanhVien_DA clsDA_ThanhVien = new ThanhVien_DA();
			DataTable dt = new DataTable();
			clsDA_ThanhVien.TenDangNhap=string_TenDangNhap;

			dt=clsDA_ThanhVien.SelectPrimaryKey(SqlCnn);
			clsDA_ThanhVien= null;
			return dt;
			}

		/// <summary>
		/// Updates a record in the ThanhVien table.
		/// <summary>
		/// <param name="TenDangNhap"></param>
		/// <param name="MatKhau"></param>
		/// <param name="IdQuyen"></param>
		/// <param name="TenDayDu"></param>
		/// <param name="NgaySinh"></param>
		/// <param name="DiaChi"></param>
		/// <param name="SoDienThoai"></param>
		/// <param name="NgayThamGia"></param>
		/// <param name="Email"></param>
		/// <param name="TrangThai"></param>
		public bool Update(SqlConnection SqlCnn)
		{
			bool boolUpdate = false ;
			ThanhVien_DA clsDA_ThanhVien = new ThanhVien_DA();
			clsDA_ThanhVien.TenDangNhap=string_TenDangNhap;
			clsDA_ThanhVien.MatKhau=string_MatKhau;
			clsDA_ThanhVien.IdQuyen=int_IdQuyen;
			clsDA_ThanhVien.TenDayDu=string_TenDayDu;
			clsDA_ThanhVien.NgaySinh=string_NgaySinh;
			clsDA_ThanhVien.DiaChi=string_DiaChi;
			clsDA_ThanhVien.SoDienThoai=string_SoDienThoai;
			clsDA_ThanhVien.NgayThamGia=string_NgayThamGia;
			clsDA_ThanhVien.Email=string_Email;
			clsDA_ThanhVien.TrangThai=bool_TrangThai;

			boolUpdate = clsDA_ThanhVien.Update(SqlCnn);
			clsDA_ThanhVien = null ;
			return boolUpdate;
		}

		/// <summary>
		/// Deletes a record from the ThanhVien table by a composite primary key.
		/// <summary>
		public bool Delete(SqlConnection SqlCnn)
		{
			bool boolDelete = false ;
			ThanhVien_DA clsDA_ThanhVien = new ThanhVien_DA();
			clsDA_ThanhVien.TenDangNhap=string_TenDangNhap;

			boolDelete = clsDA_ThanhVien.Delete(SqlCnn);
			clsDA_ThanhVien = null ;
			return boolDelete;
		}
	}

